package com.gin.supermarket_inventory_system.inventory.service;

import com.gin.common.utils.MapUtils;
import com.gin.database.base.BaseFields;
import com.gin.database.service.MyService;
import com.gin.supermarket_inventory_system.inventory.entity.PurveyorPo;

import java.util.HashMap;

/**
 *
 * @since : 2023/10/10 11:52
 * @author : ginstone
 * @version : v1.0.0
 **/
public interface PurveyorService extends MyService<PurveyorPo> {
    /**
     * 查询供应商id到名称的映射
     * @return 供应商id到名称的映射
     */
    default HashMap<Long, String> findIdNameMap() {
        return MapUtils.coll2Map(list(), BaseFields::getId, PurveyorPo::getName);
    }
}